//
//  UIView+IBExtention.swift
//  Weibo
//
//  Created by 韩佳 on 16/4/16.
//  Copyright © 2016年 ddg. All rights reserved.
//

import UIKit

extension UIView {
    @IBInspectable var borderWidth: CGFloat {
        set{
            self.layer.borderWidth = newValue
        }
        get{
            return self.layer.borderWidth
        }
    }
    
    @IBInspectable var borderColor: UIColor?{
        set{
         self.layer.borderColor = newValue?.CGColor
        }
        get{
            if let color = self.layer.borderColor{
                return UIColor(CGColor: color)
            }
            return nil
        }
    }
    
    @IBInspectable var cornerRadiu: CGFloat{
        get{
            return self.layer.cornerRadius
        }
        set{
           self.layer.cornerRadius = newValue
            self.layer.masksToBounds = (newValue > 0)
        }
    }
}

